<%@ page language="java" %>

<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.commons.SessionKeys,
                 com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User,
				 com.scalar.chiptrack.operations.assemblyrelease.AssemblyRelease"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/assemblyRelease.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/assembly_release.js"></script>

<SCRIPT language="JavaScript">
var focusNum = 0;
// Added by Suresh Yeruva on [ 8 AUG 2004 ]
function printViewAssemblyRelease1( )
{
        var productId="<%=request.getParameter("productId")%>";
        var processStepId="<%=request.getParameter("processStepId")%>";
        var fromLocationId="<%=request.getParameter("fromLocationId")%>";
        var toLocationId="<%=request.getParameter("locationId")%>";
        var findex=toLocationId.indexOf('/');
        var toLocationId1=toLocationId.substring(0,findex);
        <%
        int assemblyReleaseId=0;
        String tempAssemblyReleaseId=request.getParameter("assemblyReleaseId");
        if(tempAssemblyReleaseId!=null){
            if(tempAssemblyReleaseId.equals("-1")){
                 assemblyReleaseId=Integer.parseInt(request.getAttribute("assemblyReleaseId").toString());
            }else{
                 assemblyReleaseId=Integer.parseInt(tempAssemblyReleaseId);
            }
        }
        %>
        var assemblyReleaseId="<%=assemblyReleaseId%>";
	    var deviceName ="<%=request.getParameter("deviceName")%>";

	    var printViewAssemblyReleaseURL = '<%=chipTracContext%>/assemblyRelease.do?action=printView&productId='+productId+'&processStepId='+processStepId+'&fromLocationId='+fromLocationId+'&assemblyReleaseId='+assemblyReleaseId+'&toLocationId='+toLocationId1+'&deviceName='+deviceName

	    newWindow = window.open (printViewAssemblyReleaseURL,'assemblyReleasePopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
        newWindow.focus();
}

// Added by Suresh Yeruva on [ 10 AUG 2004 ]
function viewAssemblyRelease( processStepId, fromLocationId, assemblyReleaseId, locationId, deviceName )
{
	var productId       =   "<%=request.getParameter("productId")%>";
	var processStepId   =   processStepId;
	var fromLocationId  =   fromLocationId;
	var assemblyReleaseId=  assemblyReleaseId;
	var toLocationId    =   locationId;
    var deviceName      =   deviceName;
	var printViewAssemblyReleaseURL = '<%=chipTracContext%>/assemblyRelease.do?action=printView&productId='+productId+'&processStepId='+processStepId+'&fromLocationId='+fromLocationId+'&assemblyReleaseId='+assemblyReleaseId+'&toLocationId='+toLocationId+'&deviceName='+deviceName

	newWindow = window.open (printViewAssemblyReleaseURL,'assemblyReleasePopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,resizable=yes');
    newWindow.focus();
}
</SCRIPT>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
	<TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

	<!-- Side Navigation start -->
	<%@ include file="/jsp/operations/releaseMenu.jsp" %></TD>
	<!-- end of the side navigations -->

	<TD bgcolor="#ffffff">
	<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
	<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
	<TD valign="top" width="100%">

	<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
	<BR>

	<html:form action="/assemblyRelease" method="POST">
		<TABLE width="95%" align="right" cellpadding="2" cellspacing="2" border="0">
			<TR><TD colspan="4" class="NArialW" align="center">Assembly Release</TD></TR>

			<TR><TD colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></TD></TR>
			<TR><TD colspan='4'><chiptrack:errors styleClass="NArialL"/></TD></TR>
			<TR><TD colspan='4' class="NArialL"><chiptrack:info styleClass="NArialL"/><% if( request.getAttribute( "info" ) != null ){%>Click here to <a href='javascript:printViewAssemblyRelease1();' onmouseover="window.status='Click to Mail Assembly Release.';return true" onmouseout="window.status='';return true">view/print</a> Assembly Release Details<%}%></TD></TR>
			<TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>

			<logic:equal name="action" value="">
			<TR><TD class="NArialL" width="25%"> Select Base Product :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="productId" styleClass="txfield" onchange="javascript:submitBaseProduct();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="baseProductList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="50%" colspan="2">&nbsp;</TD>
			</TR>
			</logic:equal>


			<logic:equal name="action" value="partNumber">
			<TR><TD class="NArialL" width="25%"> Select Base Product :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="productId" styleClass="txfield" onchange="javascript:submitBaseProduct();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="baseProductList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%"> Assembly Part No :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="processStepId" styleClass="txfield" onchange="javascript:submitDeviceNumber();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="partNumberList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			</TR>
			</logic:equal>


			<logic:equal name="action" value="deviceName">
			<TR><TD class="NArialL" width="25%"> Select Base Product :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="productId" styleClass="txfield" onchange="javascript:submitBaseProduct();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="baseProductList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%"> Assembly Part No :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="processStepId" styleClass="txfield" onchange="javascript:submitDeviceNumber();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="partNumberList" property="value" labelProperty="label"/>
				</html:select>
			</TD></TR>
			<TR><TD class="NArialL" width="25%"> Assembly Location :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="locationId" styleClass="txfield" >
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="vendorLocationList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%">Assembly Release status:</TD>
			<TD class="NArialL" width="25%">
				<html:select property="status" styleClass="txfield" >
				<html:option value="0">All</html:option>
				<html:options collection="assemblyReleaseStatus" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			</TR>

            <TR><TD class="NArialL" width="25%"> Select From Location :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="fromLocationId" styleClass="txfield" multiple = "true" >
				<!--html:option value="-1">---- Select ----<!--/html:option-->
				<html:options collection="vendorFromLocationList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%">&nbsp;</TD>
			<TD class="NArialL" width="25%">&nbsp;</TD>
			</TR>


			<TR><TD class="NArialL" width="100%" colspan="4" align="left"><BR>
				Click here to <a href="javascript:generateRelease()" onMouseOver="window.status='Click to Generate a new Assembly Release.';return true" onmouseout="window.status='';return true">Generate</a> a new Assembly Release
			</TD></TR>
			<TR><TD class="NArialL" width="100%" colspan="4" align="center">
				<a href="javascript:searchLotStatus()">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/search.gif" width="59" height="17" onMouseOver="window.status='Click to Search for Assembly Release.';return true" onmouseout="window.status='';return true" title="Click here to Search for Assembly Release"></a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="<%=chipTracContext%>/assemblyRelease.do">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="59" height="17" onMouseOver="window.status='Click to Reset Assembly Release.';return true" onmouseout="window.status='';return true" title="Click here to Reset Assembly Release"></a>
			</TD></TR>
			</logic:equal>

			<logic:equal name="action" value="lotNumber">
			<TR><TD class="NArialL" width="25%"> Select Base Product :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="productId" styleClass="txfield" onchange="javascript:submitBaseProduct();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="baseProductList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%"> Assembly Part No :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="processStepId" styleClass="txfield" onchange="javascript:submitDeviceNumber();">
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="partNumberList" property="value" labelProperty="label"/>
				</html:select>
			</TD></TR>
			<TR><TD class="NArialL" width="25%"> Assembly Location :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="locationId" styleClass="txfield" >
				<html:option value="-1">---- Select ----</html:option>
				<html:options collection="vendorLocationList" property="value" labelProperty="label"/>
				</html:select>
			</TD>

			<TD class="NArialL" width="25%">Assembly Release status:</TD>
			<TD class="NArialL" width="25%">
				<html:select property="status" styleClass="txfield" >
				<html:option value="0">All</html:option>
				<html:options collection="assemblyReleaseStatus" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			</TR>
            <TR><TD class="NArialL" width="25%"> Select From Location :</TD>
			<TD class="NArialL" width="25%">
				<html:select property="fromLocationId" styleClass="txfield" multiple = "true">
				<%--<html:option value="-1">---- Select ----</html:option>--%>
				<html:options collection="vendorFromLocationList" property="value" labelProperty="label"/>
				</html:select>
			</TD>
			<TD class="NArialL" width="25%">&nbsp;</TD>
			<TD class="NArialL" width="25%">&nbsp;</TD>
			</TR>

			<TR><TD class="NArialL" width="100%" colspan="4" align="left"><BR>
				Click here to <a href="javascript:generateRelease()" onMouseOver="window.status='Click to Generate New Assembly Release.';return true" onmouseout="window.status='';return true" >Generate</a> a new Assembly Release
			</TD></TR>
			<TR><TD class="NArialL" width="100%" colspan="4" align="center">
				<a href="javascript:searchLotStatus()">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/search.gif" width="59" height="17" onMouseOver="window.status='Click to Search for Assembly Release Details.';return true" onmouseout="window.status='';return true" title="Click here to Search for Assembly Release Details"></a>
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="javascript:resetPage()">
				<img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="59" height="17" onMouseOver="window.status='Click to Reset Assembly Release Details.';return true" onmouseout="window.status='';return true" title="Click here to Reset Assembly Release Details"></a>
			</TD></TR>
			<TR><TD class="NArialL" width="100%" colspan="4" align="left"><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height="20" width="1"></TD></TR>

			<TR><TD class="NArialL" width="100%" colspan="4" align="center">
			<TABLE width="100%">
			<TR>
				<TD width="10%" align="center" bgcolor="#FFFFFF" class="NArialL"><font color="#FFFFFF">&nbsp;</font></TD>
				<TD width="20%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">PO Number</font></TD>
				<TD width="20%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Status</font></TD>
				<TD width="20%" align="center" bgcolor="#993333" class="NArialL"><font color="#FFFFFF">Action</font></TD>
				<TD width="10%" align="center" bgcolor="#FFFFFF" class="NArialL"><font color="#FFFFFF">&nbsp;</font></TD>
			</TR>
			<logic:present name="lotReleaseDetails" >
			    <logic:iterate id="lotReleaseDetails" name="lotReleaseDetails" >
                    <TR>
                    <TD width="10%" align="center" bgcolor="#FFFFFF" class="NArialL">
                    <font color="#FFFFFF">
                    </font>
                    </TD>
                    <TD width="20%" align="left" bgcolor="#DEE1E2" class="NArialL">
                        &nbsp;<bean:write name ="lotReleaseDetails" property="poNumber" />
                    </TD>

                    <TD width="20%" align="left" bgcolor="#DEE1E2" class="NArialL">
                        &nbsp;<bean:write name = "lotReleaseDetails" property="assemblyReleaseStatus" />
                    </TD>

                    <TD width="20%" align="center" bgcolor="#DEE1E2" class="NArialL">
                        <logic:equal name = "lotReleaseDetails" property="assemblyReleaseStatus" value="Issued">
                        <a href="javascript:getAssemblyReleaseScreen( <bean:write name = "lotReleaseDetails" property="assemblyReleaseId" />, <bean:write name = "lotReleaseDetails" property="processStepId" />, <bean:write name = "lotReleaseDetails" property="fromLocationId" /> );" onMouseOver="window.status='Click to View/Modify Assembly Release Details.';return true" onmouseout="window.status='';return true">
                        View/Modify
                        </a>
                        </logic:equal>
                        <logic:equal name = "lotReleaseDetails" property="assemblyReleaseStatus" value="Cancelled">
                        <a href="javascript:viewAssemblyRelease( <bean:write name = "lotReleaseDetails" property="processStepId" />, <bean:write name = "lotReleaseDetails" property="fromLocationId" />, <bean:write name = "lotReleaseDetails" property="assemblyReleaseId" />, <bean:write name = "lotReleaseDetails" property="locationId" />, '<bean:write name = "lotReleaseDetails" property="deviceName" />' );" onMouseOver="window.status='Click to View Assembly Release Details.';return true" onmouseout="window.status='';return true"><!--Added by Suresh Yeruva on [ 10 AUG 2004 ].-->
                        View
                        </a>
                        </logic:equal>
                        <logic:equal name = "lotReleaseDetails" property="assemblyReleaseStatus" value="Shipped">
                        <a href="javascript:viewAssemblyRelease( <bean:write name = "lotReleaseDetails" property="processStepId" />, <bean:write name = "lotReleaseDetails" property="fromLocationId" />, <bean:write name = "lotReleaseDetails" property="assemblyReleaseId" />, <bean:write name = "lotReleaseDetails" property="locationId" />, '<bean:write name = "lotReleaseDetails" property="deviceName" />' );" onMouseOver="window.status='Click to View Assembly Release Details.';return true" onmouseout="window.status='';return true"><!--Added by Suresh Yeruva on [ 10 AUG 2004 ].-->
                        View
                        </a>
                        </logic:equal>
                    </TD>
                    <TD width="10%" align="center" bgcolor="#FFFFFF" class="NArialL">
                    <font color="#FFFFFF">
                        &nbsp;
                    </font>
                    </TD>
                    </TR>
			    </logic:iterate>
			</logic:present>
			</TABLE>
			</TD></TR>
			</logic:equal>
			<TR><TD colspan='4' class="NArialL">
			<IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'>
			</TD></TR>
		</TABLE>
		<input type="hidden" name="assemblyReleaseIdTemp"><!--Do not delete this property.-->
		<input type="hidden" name="action" ><!--Do not delete this property.-->
		<input type="hidden" name="productIdTemp" ><!--Do not delete this property.-->
		<input type="hidden" name="locationIdTemp" ><!--Do not delete this property.-->
		<input type="hidden" name="processStepIdTemp" ><!--Do not delete this property.-->
		<input type="hidden" name="vendorIdTemp" ><!--Do not delete this property.-->

	</html:form>

<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>